from celery import Celery

import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'meiduo_mall.settings.dev')

broker = 'redis://192.168.0.211:6379/11'
backend = 'redis://192.168.0.211:6379/12'

# 1 创建celery实例对象
app = Celery('tasks', broker=broker, backend=backend)

# 2 加载配置文件
# app.config_from_object('celery_tasks.config')

# 3 自动注册异步任务
app.autodiscover_tasks(['celery_tasks.email'])
